package com.hw.service.sys;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hw.entity.po.sys.SysRole;
import com.hw.mapper.sys.SysRoleMapper;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 角色 Service实现类
 *
 * @author whw
 * @date 2021-06-21
 */
@Service
public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> implements SysRoleService {
    @Override
    public List<SysRole> list(String username) {
        QueryWrapper<SysRole> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("role.c_deleted", 0)
                .eq("user.c_username", username);
        return baseMapper.list(queryWrapper);
    }
}
